<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>


		<title>登录</title>

		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
		<meta http-equiv="description" content="This is my page" />
		<link rel="stylesheet" type="text/css"
			href="../../resources/css/login.css" />
		<script type="text/javascript" src="../../scripts/jquery-1.4.2.js">	</script>
		<script type="text/javascript" src="login.js">	</script>
		<script type="text/javascript" src="../../scripts/cookie.js">	</script>

		<script>
<!--
function settab_zzjsnet(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var zzjs=document.getElementById("zzjs_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  zzjs.style.display=i==cursel?"block":"none";
 }
}
function checkLogin1() {
     var userName =$("#userName");
  if(userName.val().trim().length==0)
  {
     alert("请输入用户名!");
     userName.focus();
     return;
  }
  var password =$("#password");
   if(password.val().trim().length==0)
  {
     alert("请输入密码!");
     password.focus();
     return;
  }
  var userName = $("#userName").val();
  var password = $("#password").val();
  if($("#chkRememberUsername").attr("checked")){
    setCookie("userName",userName,24,"/");
    setCookie("password",password,24,"/");
    if($("#chkRememberMe").attr("checked")){
    	setCookie("chkRememberMe","true",24,"/");	
    }
  }
    document.forms[0].submit();
}
var ccc = "${login_failure}";
function oninit(){
	if(ccc!=''){
		deleteCookie("userName","/");
		deleteCookie("password","/");
		deleteCookie("chkRememberMe","/");
		$('#userName').focus();
	}
	var userNameValue = getCookieValue("userName");   
    $("#userName").val(userNameValue);
   	var passwordValue = getCookieValue("password");   
    $("#password").val(passwordValue);
    if(getCookieValue("chkRememberMe")=='true'){
	    document.forms[0].submit();
    }
}
</script>

	</head>

	<body onload="oninit();">
		<form action="../../user/forwordLogin1.action" method="post" target="myForm">
			<div class="logset">
				<a href="#">会员登录</a>
				<a href="../register/register.jsp">新用户注册</a>
			</div>
			<div class="content">
			<a href="<%=basePath%>">
				<img src="../../resources/images/web/findCipher_03.png" width="213"
					height="111" />
			</a>
			</div>


			<div class="fc-wr" align="center">
				<div class="title">
					<span class="iml"><img
							src="../../resources/images/web/findCipher_09.png" alt=""
							width="4" height="33" /> </span><span>&nbsp;&nbsp;用户登录</span><span
						class="imr"><img src="../../resources/images/web/findCipher_12.png" width="4"
							height="33" /> </span>
				</div>
				<div class="cont">

					<div
						style="float: left; width: 608px; height: 236px; overflow: hidden">
						<div class="item">
							<span class="label">用户名：</span>

							<span class="input1"><input type="text" id="userName" onkeypress="if(event.keyCode==13) { $('#password').focus();}"
									name="user" />&nbsp;<font color="red">&nbsp;</font></span>
						</div>
						<div class="item">
							<span class="label">密&nbsp;&nbsp;码：</span>

							<span class="input1"><input type="password" id="password" onkeypress="if(event.keyCode==13) {checkLogin1(); }"
									name="pass" /> </span>

							<span style="width: 100px; margin-left: 20px"><a href="findpassword.jsp">忘记密码</a>
							</span>
						</div>
						
						<div class="item" align="left">
							<label class="label">
								<input type="checkbox" class="checkbox" checked="checked"
									id="chkRememberUsername" name="chkRememberUsername" />
								记住用户名
							</label>
							<label class="label">
								<input type="checkbox" class="checkbox" id="chkRememberMe"
									name="chkRememberMe" />
								自动登录
							</label>

						</div>


						<div class="item">
							<input type="button" class="btn-img" onclick="checkLogin1()"  style="cursor: pointer;" value="登 录" />
						</div>

					</div>
					<div
						style="float: right; width: 379px; height: 236px; border-left: 1px solid #e7e7e7">
						<div class="regis" align="left">
							<B>还不是我们的用户？</B>
							<p>
								现在立即注册，注册之后即可进行咨询！
							</p>
							<a href="../register/register.jsp">注册新用户</a>
						</div>
						<img src="../../resources/images/web/login_10.jpg" width="313"
							height="74" style="margin-left: 40px; margin-top: 30px" />
					</div>
				</div>


			</div>


			<div class="foot">
				<p>
					<a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage(window.location.href);" href="javascript:;">把网站设为主页</a> &nbsp;&nbsp;&nbsp;
					<a href="javascript:window.external.addFavorite(window.location.href,'医生在线');">把网站添加到收藏夹</a>
				</p>
				<p>
					<a href="<%=basePath%>aboutus/show.action?id=1">关于我们</a> |
					<a href="<%=basePath%>aboutus/show.action?id=1">About US</a>
				</p>
				<p>
					<a href="#">&copy;2012 备案号：京ICP证xxxxxxx号</a>
				</p>
			</div>
		</form>
		<iframe name="myForm" id="myForm" style="display: none"></iframe>
	</body>
</html>
